# eric7.UI.EmailDialog

Module implementing a dialog to send bug reports or feature requests.

### Global Attributes

None

### Classes

EmailDialog | Class implementing a dialog to send bug reports or feature requests.

### Functions

None

## EmailDialog

Class implementing a dialog to send bug reports or feature requests.

### Derived from

QDialog, Ui_EmailDialog

### Class Attributes

None

### Class Methods

None

### Methods

EmailDialog | Constructor
__createMultipartMail | Private method to create a multipart mail message.
__createSimpleMail | Private method to create a simple mail message.
__deleteAttachedFiles | Private method to delete attached files.
__encodedHeader | Private method to create a correctly encoded mail header.
__encodedText | Private method to create a MIMEText message with correct encoding.
__gmailSendResult | Private slot handling the send result reported by the Google Mail interface.
__sendmail | Private method to actually send the message.
__sendmailGoogle | Private method to actually send the message via Google Mail.
attachFile | Public method to add an attachment.
keyPressEvent | Protected method to handle the user pressing the escape key.
on_addButton_clicked | Private slot to handle the Add...
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_buttonBox_rejected | Private slot to handle the rejected signal of the button box.
on_deleteButton_clicked | Private slot to handle the Delete button.
on_googleHelpButton_clicked | Private slot to show some help text "how to turn on the Gmail API".
on_message_textChanged | Private slot to handle the textChanged signal of the message edit.
on_sendButton_clicked | Private slot to send the email message.
on_subject_textChanged | Private slot to handle the textChanged signal of the subject edit.

### Static Methods

None

#### EmailDialog (Constructor)

EmailDialog(mode="bug", parent=None)

Constructor

mode (str)
  mode of this dialog ("bug" or "feature")
parent (QWidget)
  parent widget of this dialog

#### EmailDialog.__createMultipartMail

__createMultipartMail()

Private method to create a multipart mail message.

Return:
  prepared mail message

Return Type:
  email.mime.text.MIMEMultipart

#### EmailDialog.__createSimpleMail

__createSimpleMail()

Private method to create a simple mail message.

Return:
  prepared mail message

Return Type:
  email.mime.text.MIMEText

#### EmailDialog.__deleteAttachedFiles

__deleteAttachedFiles()

Private method to delete attached files.

#### EmailDialog.__encodedHeader

__encodedHeader(txt)

Private method to create a correctly encoded mail header.

txt (str)
  header text to encode

Return:
  encoded header

Return Type:
  email.header.Header

#### EmailDialog.__encodedText

__encodedText(txt)

Private method to create a MIMEText message with correct encoding.

txt (str)
  text to be put into the MIMEText object

Return:
  MIMEText object

Return Type:
  email.mime.text.MIMEText

#### EmailDialog.__gmailSendResult

__gmailSendResult(ok, message)

Private slot handling the send result reported by the Google Mail interface.

ok (bool)
  flag indicating success
message (str)
  message from the interface

#### EmailDialog.__sendmail

__sendmail(msg)

Private method to actually send the message.

msg (str)
  the message to be sent

Return:
  flag indicating success

Return Type:
  bool

#### EmailDialog.__sendmailGoogle

__sendmailGoogle(msg)

Private method to actually send the message via Google Mail.

msg (email.mime.text.MIMEBase)
  email message to be sent

#### EmailDialog.attachFile

attachFile(fname, deleteFile)

Public method to add an attachment.

fname (str)
  name of the file to be attached
deleteFile (bool)
  flag indicating to delete the file after it has been sent

#### EmailDialog.keyPressEvent

keyPressEvent(ev)

Protected method to handle the user pressing the escape key.

ev (QKeyEvent)
  key event

#### EmailDialog.on_addButton_clicked

on_addButton_clicked()

Private slot to handle the Add... button.

#### EmailDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
  button that was clicked

#### EmailDialog.on_buttonBox_rejected

on_buttonBox_rejected()

Private slot to handle the rejected signal of the button box.

#### EmailDialog.on_deleteButton_clicked

on_deleteButton_clicked()

Private slot to handle the Delete button.

#### EmailDialog.on_googleHelpButton_clicked

on_googleHelpButton_clicked()

Private slot to show some help text "how to turn on the Gmail API".

#### EmailDialog.on_message_textChanged

on_message_textChanged()

Private slot to handle the textChanged signal of the message edit.

#### EmailDialog.on_sendButton_clicked

on_sendButton_clicked()

Private slot to send the email message.

#### EmailDialog.on_subject_textChanged

on_subject_textChanged(txt)

Private slot to handle the textChanged signal of the subject edit.

txt (str)
  changed text

Up